<?php
namespace Plugin\Attractions\AttractionManagement\Schema\Attraction_booking;

use Plugin\Attractions\AttractionManagement\Model\Attraction_booking\AttractionUserBooking;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 预约订单表
 */
#[Schema(title: 'AttractionUserBookingSchema')]
class AttractionUserBookingSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: '预约订单编号', type: 'bigint')]
    public string $id;

    #[Property(property: 'user_id', title: '用户id', type: 'int')]
    public string $user_id;

    #[Property(property: 'info_id', title: '预约活动信息id', type: 'int')]
    public string $info_id;

    #[Property(property: 'booking_day', title: '预约日期', type: 'datetime')]
    public string $booking_day;

    #[Property(property: 'booking_time', title: '预约时间段', type: 'varchar')]
    public string $booking_time;

    #[Property(property: 'status', title: '预约状态1已预约2已取消3已使用', type: 'int')]
    public string $status;

    #[Property(property: 'created_at', title: 'created_at', type: 'datetime')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'datetime')]
    public string $updated_at;

    #[Property(property: 'deleted_at', title: 'deleted_at', type: 'timestamp')]
    public string $deleted_at;




    public function __construct(AttractionUserBooking $model)
    {
       $this->id = $model->id;
       $this->user_id = $model->user_id;
       $this->info_id = $model->info_id;
       $this->booking_day = $model->booking_day;
       $this->booking_time = $model->booking_time;
       $this->status = $model->status;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;
       $this->deleted_at = $model->deleted_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'user_id' => $this->user_id ,'info_id' => $this->info_id ,'booking_day' => $this->booking_day ,'booking_time' => $this->booking_time ,'status' => $this->status ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at ,'deleted_at' => $this->deleted_at];
    }
}